from google.appengine.ext import db
from google.appengine.ext.webapp import template
from google.appengine.ext.db import djangoforms
from django.newforms.util import ValidationError
import django.newforms as forms
import glp.users
from glp.users import User
import glp.django.widgets

class RegistrationForm(djangoforms.ModelForm):
    first_name = forms.CharField(label='Given Name')
    last_name = forms.CharField(label='Family Name')
    role = forms.ChoiceField(
        label='Who are you?',
        help_text="Tell us what you do at your school.",
        choices=(
            ('', 'Choose your job or role'),
            ('policymaker', 'Policymaker'),
            ('administrator', 'Administrator'),
            ('teacher', 'Teacher'),
            ('parent', 'Parent'),
            ('student', 'Student'),
            ('adult-learner', 'Adult Learner'),
            ('other', 'Other')))
    school = forms.ChoiceField(
        label='Where are you?',
        help_text="Tell us the school which you attend, where you teach, or where your child attends.",
        choices=(
            ('', 'Select your school'),
            ('kist', 'Kigali Institute of Science and Technology'),
            ('kie', 'Kigali Institute of Education'),
            ('coe-kivuma', 'CoE Kivuma'),
            ('coe-rukara', 'CoE Rukara'),
            ('ttc-bicumbi', 'TTC Bicumbi'),
            ('ttc-byumba', 'TTC Byumba'),
            ('ttc-gacuba', 'TTC Gacuba II'),
            ('ttc-kirambo', 'TTC Kirambo'),
            ('ttc-matimba', 'TTC Matimba'),
            ('ttc-mbuga', 'TTC Mbuga'),
            ('ttc-mururu', 'TTC Mururu'),
            ('ttc-rubengera', 'TTC Rubengera'),
            ('ttc-save', 'TTC Save'),
            ('ttc-zaza', 'TTC Zaza'),
            ('other-school', 'Other school'),
            ('none', 'Not in school')))

    class Meta:
        model = User
        fields = ('first_name', 'last_name', 'role', 'school')
